refactor(pm): add pm/pm.cppm subsystem façade (PR-R7)#10
Merged
Sunrisepeak merged 1 commit intomainfrom May 8, 2026
Merged
Conversation
Final step of the package-management subsystem refactor (see `.agents/docs/2026-05-08-pm-subsystem-architecture.md`). Strictly zero behavior change. * New module `mcpp.pm` (`src/pm/pm.cppm`) is the single import point for callers in `cli.cppm`, `build/`, `pack/`, etc. It re-exports the three pm data-type modules (`dep_spec`, `index_spec`, `lock_io`) but **deliberately not** the flow modules (`resolver`, `commands`, `package_fetcher`, `publisher`) — those stay direct-import-only so the encapsulation gained by R1–R6 is preserved. * No call-site migration in this PR. Existing `import mcpp.lockfile` / `import mcpp.fetcher` / `import mcpp.publish.xpkg_emit` shims continue to work; new code can choose `import mcpp.pm` and reach the same data types via the new façade. * `prepare_dependencies(Manifest&, Lockfile&, ...)` (the high-level operation that should replace the ~250-line dep-resolution loop in `cli.cppm::prepare_build`) is left for a separate PR — pulling it out is a non-trivial behavior-touching change that doesn't belong inside the strict-move R-series. The façade leaves a clean spot for it to land later. Verification: * `mcpp build` compiles unchanged. * `mcpp test` — 9/9 unit binaries pass. * e2e: 02 / 09 / 12 / 23 / 27 all pass. Closes the seven-PR refactor sequence. The pm subsystem is now: src/pm/ ├── pm.cppm (façade, this PR) ├── dep_spec.cppm (R1) ├── index_spec.cppm (R1 placeholder, awaits index-config) ├── lock_io.cppm (R2) ├── package_fetcher.cppm (R3) ├── resolver.cppm (R4) ├── commands.cppm (R5) └── publisher.cppm (R6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the seven-PR pm subsystem refactor.
Strictly zero behavior change.
mcpp.pm(src/pm/pm.cppm) is the single import point for callersoutside the subsystem (cli, build, pack). Re-exports the three
data-type modules (
dep_spec,index_spec,lock_io) butdeliberately not the flow modules (
resolver,commands,package_fetcher,publisher) — those remain direct-import-only,preserving the encapsulation gained by R1–R6.
No call-site migration here. Existing
import mcpp.lockfile/import mcpp.fetcher/import mcpp.publish.xpkg_emitshims keepworking; new code can reach the same types via
import mcpp.pm.prepare_dependencies(the high-level operation that should replacethe ~250-line dep-resolution loop in
cli.cppm::prepare_build) isintentionally left for a separate PR. Pulling it out is
behavior-touching and doesn't belong inside the strict-move R-series.
Final pm/ subsystem layout
Test plan
mcpp build(worktree)mcpp test— 9/9 unit binaries pass